﻿//using System;
//using System.Collections.Generic;
//using System.IO;
//using System.Linq;
//using System.Text;
//using System.Xml;

//using Microsoft.VisualStudio.TestTools.UnitTesting;

//using Pibby.Core.Rss;

//namespace Pibby.Core.Tests
//{
//    [TestClass]
//    public class EnclosureTests
//    {
//        [TestMethod]
//        public void NewEnclosure_FromXml_InitialisesProperties()
//        {
//            using (TextReader reader = new StringReader("<enclosure url=\"http://www.davidco.com/audio/gtdsystem1.mp3\" length=\"3916413\" type=\"audio/mp3\"/>"))
//            {
//                XmlReaderSettings settings = new XmlReaderSettings();
//                settings.IgnoreComments = true;
//                settings.IgnoreProcessingInstructions = true;
//                settings.IgnoreWhitespace = true;

//                using (XmlReader xmlReader = XmlTextReader.Create(reader, settings))
//                {
//                    xmlReader.Read();

//                    Assert.AreEqual(XmlNodeType.Element, xmlReader.NodeType, "First element must be enclosure");
//                    Assert.AreEqual("enclosure", xmlReader.Name);

//                    Enclosure enclosure = Enclosure.Create (xmlReader);

//                    Assert.AreEqual("http://www.davidco.com/audio/gtdsystem1.mp3", enclosure.Url.AbsoluteUri);
//                    Assert.AreEqual(3916413, enclosure.Length);
//                    Assert.AreEqual(EnclosureMimeType.Audio, enclosure.MimeType);
//                }
//            }
//        }

//        [TestMethod]
//        public void NewEnclosure_FromKnownFileType_InfersProperties()
//        {
//            string fileName = "http://www.davidco.com/audio/gtdsystem1.mp3";

//            Enclosure enclosure = Enclosure.Create(fileName);

//            Assert.AreEqual("http://www.davidco.com/audio/gtdsystem1.mp3", enclosure.Url.AbsoluteUri);
//            Assert.AreEqual(0, enclosure.Length, "Can't tell how big the file is");
//            Assert.AreEqual(EnclosureMimeType.Audio, enclosure.MimeType);
//        }

//    }
//}
